@model UpdaterManagement.Models.Product

<nav aria-label="breadcrumb" class="breadcrumb-ace">
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="/">首页</a></li>
        <li class="breadcrumb-item"><a href="/Product">产品管理</a></li>
        <li class="breadcrumb-item active">编辑产品</li>
    </ol>
</nav>

<div class="page-header">
    <div class="d-flex justify-content-between align-items-center">
        <div>
            <h1 class="page-title">
                <i class="bi bi-pencil text-primary me-2"></i>编辑产品
            </h1>
            <p class="page-subtitle">修改产品 <strong>@Model.Name</strong> 的信息</p>
        </div>
        <a href="/Product" class="btn btn-outline-secondary">
            <i class="bi bi-arrow-left me-2"></i>返回列表
        </a>
    </div>
</div>

<div class="row">
    <div class="col-lg-8">
        <div class="card-ace">
            <div class="card-header">
                <i class="bi bi-form-check me-2"></i>产品信息
            </div>
            <div class="card-body">
                <partial name="_ErrorAlert" />
                
                <form method="post">
                    <input type="hidden" asp-for="Id" />
                    <input type="hidden" asp-for="CreatedTime" />
                    
                    <div class="mb-3">
                        <label class="form-label-ace">
                            <i class="bi bi-tag text-primary me-1"></i>产品名称
                        </label>
                        <input type="text" class="form-control form-control-ace" asp-for="Name" required />
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label-ace">
                            <i class="bi bi-chat-text text-primary me-1"></i>产品说明
                        </label>
                        <textarea class="form-control form-control-ace" asp-for="Description" rows="3"></textarea>
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label-ace">
                            <i class="bi bi-building text-primary me-1"></i>所属部门
                        </label>
                        <select class="form-select form-control-ace" asp-for="DepartmentId" required>
                            @foreach (var dept in ViewBag.Departments as List<UpdaterManagement.Models.Department>)
                            {
                                <option value="@dept.Id">@dept.Name - @dept.Manager</option>
                            }
                        </select>
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label-ace">
                            <i class="bi bi-gear text-primary me-1"></i>部署类型
                        </label>
                        <select class="form-select form-control-ace" asp-for="Type" required>
                            <option value="iis">IIS网站</option>
                            <option value="service">Windows服务</option>
                        </select>
                    </div>
                    
                    <div class="d-flex gap-2 pt-3 border-top">
                        <button type="submit" class="btn btn-ace-primary">
                            <i class="bi bi-check-circle me-2"></i>保存修改
                        </button>
                        <a href="/Product" class="btn btn-outline-secondary">
                            <i class="bi bi-x-circle me-2"></i>取消
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    
    <div class="col-lg-4">
        <div class="card-ace">
            <div class="card-header">
                <i class="bi bi-clock text-info me-2"></i>产品信息
            </div>
            <div class="card-body">
                <div class="mb-0">
                    <strong class="text-muted">创建时间:</strong>
                    <br>@Model.CreatedTime.ToString("yyyy-MM-dd HH:mm:ss")
                </div>
            </div>
        </div>
    </div>
</div>